<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<table>
    <tr>
        <c:choose>
            <c:when test="${model.listType ne 'users'}">
                <c:url value="home.view" var="previousUrl">
                    <c:param name="listType" value="${model.listType}"/>
                    <c:param name="listOffset" value="${model.listOffset - model.listSize}"/>
                </c:url>
                <c:url value="home.view" var="nextUrl">
                    <c:param name="listType" value="${model.listType}"/>
                    <c:param name="listOffset" value="${model.listOffset + model.listSize}"/>
                </c:url>

                <c:if test="${fn:length(model.elements) gt 0}">
                    <td style="padding-right:0.5em">
                        <fmt:message key="home.elements">
                            <fmt:param value="${model.listOffset + 1}"/>
                            <fmt:param value="${model.listOffset + fn:length(model.elements)}"/>
                        </fmt:message>
                    </td>
                </c:if>

                <c:if test="${model.listOffset gt 0}">
                    <td><a href="${previousUrl}"><img src="<spring:theme code="backImage"/>" alt=""></a></td>
                </c:if>

                <c:if test="${fn:length(model.elements) eq model.listSize}">
                    <td><a href="${nextUrl}"><img src="<spring:theme code="forwardImage"/>" alt=""></a></td>
                </c:if>
                    
            </c:when>
        </c:choose>
    </tr>
</table>